<!DOCTYPE html>
<html lang="utf-8">
<head>
    <meta charset="UTF-8">
    <#include "/comm/module-index.ftl"/>
</head>
<#include "/comm/js_user_all.ftl">
<body>
<div class="layui-div-body">
    <div class="layui-fluid  layui-div-table">
        <div>
            <form class="layui-form searchForm" autocomplete="off" id="searchForm" lay-filter="searchForm">
                <div class="layui-inline layui-show-xs-block layui-input-wrap">
                    <div class="layui-input-prefix">
                        <i class="layui-icon layui-icon-date"></i>
                    </div>
                    <input class="layui-input table-search-date" autocomplete="off" placeholder="开始日"
                           name="startDate" id="start">
                </div>
                <div class="layui-inline layui-show-xs-block  layui-input-wrap">
                    <div class="layui-input-prefix">
                        <i class="layui-icon layui-icon-date"></i>
                    </div>
                    <input class="layui-input table-search-date" autocomplete="off" placeholder="截止日" name="endDate"
                           id="end">
                </div>
                <div class="layui-inline layui-show-xs-block">
                    <input type="text" name="keyword" placeholder="关键字" autocomplete="off"
                           class="layui-input">
                </div>
                <div class="layui-inline layui-show-xs-block">
                    <button class="layui-btn  layui-btn-sm" lay-submit="" lay-filter="table-search"><i
                                class="layui-icon"></i>查询
                    </button>
                    <button class="layui-btn  layui-btn-sm layui-btn-primary" type="reset" id="btn-search-reset"><i
                                class="layui-icon"></i>重置
                    </button>

                </div>
            </form>

        </div>
        <#-- table-->
        <div class="layui-table-body" style="flex: 1;margin-top: 20px;" id="layui-table-bar">
            <table class="layui-hide" lay-filter="layui-table-main" id="layui-table-main"></table>
        </div>
    </div>
</div>
<script type="text/html" id="myOperateBtn">
    <@shiro code="gen:feedback:status">
    {{#  if(d._status >-2){ }}
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
    {{#  } }}
    </@shiro>
    <@shiro code="gen:feedback:detail">
    <a class="layui-btn layui-btn-xs" lay-event="detail">详情</a>
    </@shiro>
</script>
<script type="text/html" id="myStatusBtn">
    {{#  if(d._status==1){ }}
    <button class="layui-btn layui-btn-primary layui-border-green layui-btn-xs">正常</button>
    {{#  } else { }}
    <button class="layui-btn layui-btn-primary layui-btn-xs">禁用</button>
    {{#  } }}
</script>
<script type="text/javascript">
    layui.use(['index'], function () {
        let tableBase = layui.index;
        tableBase.render({
            cols: [ {type: 'space', hide: true, field: "_id"},
                {type: 'numbers', title: "序号", fixed: 'left'},
                {field: 'phone', title: '电话'},
                {field: 'context', title: '内容'},
                {field: 'createTime', title: '日期'},
                {field: 'userId', title: '用户ID'},
                {
                    field: "replyUserId", title: "是否回复", width: 80, align: 'center', templet: function (obj) {
                        return obj.replyUserId?"已回复":"否";
                    }
                },
                {field: 'replyTime', title: '回复时间'},
                {fixed: 'right', title: '操作', toolbar: '#myOperateBtn', width: 130, align: 'center'}

            ],
            area: ['900px', '550px']
        })

    });

</script>
</body>
</html>
